<?php
class Modules_Milestone_Model_CreateMilestone
	{
		public $result=array("error"=>"","result"=>0);
		public function Modules_Milestone_Model_CreateMilestone($args=null)
		{
			if($args==null)
				return;
			try{	
			
			$start_time=explode(".",$args['Start']);
			$start=mktime(0, 0, 0, $start_time[1]  , $start_time[0], $start_time[2]);	
			$end_time=explode(".",$args['End']);
			$end=mktime(0, 0, 0, $end_time[1]  , $end_time[0], $end_time[2]);
			
			$projects=new Modules_Common_DB_Projects($_SESSION['project']);
			$projects->CreateNewMilestone($args['Name'],$start,$end);
			$this->result=1;	
			}
			catch(Exception $e)
			{
				$this->result=0;
				$this->error=$e->getMessage();
			}
			
		}
		public function Init()
		{
			
		}
	}
?>